package homework.homework05;

public class Book {
    private String id;//图书编号
    private String name;//书名
    private int price;//价格
    //有参构造

    public Book(String id, String name, int price) {
        this.id = id;
        this.name = name;
        this.price = price;
    }
    //无参构造
    public Book(){}

    //get and set
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "图书{" +
                "图书编号='" + id + '\'' +
                ", 书名='" + name + '\'' +
                ", 价格=" + price +
                '}';
    }
}
